home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / MODOBJ_1.ARJ / TCMOD.C < prev    next >
Text File  |  1992-04-15  |  1KB  |  61 lines

  1. /* C routines to demonstate MOD-OBJ */
  2. /* You need a project file called TCMOD.PRJ containing the two lines
  3.      tcmod.c
  4.      mod-obj.obj
  5. */
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <conio.h>
  10.  
  11. void far moddevice( int *device );
  12. void far modvolume( int vol1, int vol2,int vol3,int vol4);
  13. void far modsetup( char *filenm, int looping, int prot,int mixspeed,
  14.                                      int device, int *status);
  15. void far modstop(void);
  16. void far modinit(void);
  17.  
  18. main()
  19. {
  20.     int dev,mix,vol,stat;
  21.     char md[41];
  22.  
  23.     modinit();
  24.     moddevice( &dev );
  25.     if (dev == 255) exit(2);
  26.     if (dev == 0)
  27.     {
  28.         printf("\n* The speaker won't sound very good playing back a module\n");
  29.         printf("* Why not make a simple D/A converter using some resistors\n");
  30.         printf("* as detailed in HARDWARE.DOC - it will only cost a couple\n");
  31.         printf("* of pounds/dollars\n\n\n");
  32.     }
  33.     printf("Enter filename          : ");
  34.     gets(md);
  35.     vol = 255;
  36.     mix = 10000;
  37.     modvolume(vol,vol,vol,vol);
  38.     modsetup( md, 4, 0 ,mix, dev, &stat );
  39.     printf("\n");
  40.     if (stat==1)
  41.                     {
  42.                         printf("Not a mod!\n");
  43.                         exit(1);
  44.                     }
  45.     if (stat==2)
  46.                     {
  47.                         printf("Already playing!\n");
  48.                         exit(1);
  49.                     }
  50.     if (stat==4)
  51.     {
  52.                         printf("Out of memory!\n");
  53.                         exit(1);
  54.     }
  55.  
  56.     for (dev=0;dev<1000;dev++)
  57.         printf("I'm counting to 1000...  %d  ",dev);
  58.  
  59.     modstop();
  60.     exit(0);
  61. }